﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/Main.Master" AutoEventWireup="true" CodeBehind="RolesAllocation.aspx.cs" Inherits="RestaurantManagerWebApp.Pages.UserManagement.RolesAllocation" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .Initial {
            display: block;
            padding: 4px 18px 4px 18px;
            float: left;
            background: url("InitialImage.png") no-repeat right top;
            color: Black;
            font-weight: bold;
        }

            .Initial:hover {
                color: darkblue;
                background: url("~//Images//Controls//SelectedButton.png") no-repeat right top;
            }

        .Clicked {
            float: left;
            display: block;
            background: url("~//Images//Controls//SelectedButton.png") no-repeat right top;
            padding: 4px 18px 4px 18px;
            color: Black;
            font-weight: bold;
            color: blue;
        }
    .auto-style2 {
        width: 230px;
    }
    .auto-style3 {
        width: 229px;
    }
    .auto-style4 {
        width: 227px;
    }
    .auto-style5 {
        width: 78px;
    }
    .auto-style7 {
        width: 187px;
        text-align: center;
    }
    .auto-style8 {
        width: 106px;
        text-align: right;
    }
    .auto-style9 {
        width: 100%;
        height: 122px;
    }
    .auto-style10 {
    }
    .auto-style11 {
        width: 78px;
        height: 19px;
    }
    .auto-style12 {
        width: 106px;
        text-align: right;
        height: 19px;
    }
    .auto-style13 {
        height: 19px;
    }
    .auto-style15 {
        width: 229px;
        text-align: center;
        height: 26px;
    }
    .auto-style16 {
        width: 78px;
        height: 26px;
    }
    .auto-style17 {
        width: 106px;
        text-align: right;
        height: 26px;
    }
    .auto-style18 {
        height: 26px;
    }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="80%" align="center">
        <tr>
            <td>
                <asp:Button Text="Add Roles" BorderStyle="None" ID="Tab1" CssClass="Initial" runat="server"
                    OnClick="Tab1_Click" CausesValidation="False" />
                <asp:Button Text="Edit Roles" BorderStyle="None" ID="Tab2" CssClass="Initial" runat="server"
                    OnClick="Tab2_Click" CausesValidation="False" />
                <asp:MultiView ID="MainView" runat="server">
                    <asp:View ID="View1" runat="server">
                        <table style="border: 1px solid #666;" class="auto-style9">
                            <tr>
                                <td class="auto-style7">
                                   
                                </td>
                                <td class="auto-style5">
                                   
                                    <asp:Label ID="lblRoleName" runat="server" Text="Role Name:"></asp:Label>
                                   
                                </td>
                                <td class="auto-style8">
                                   
                                    <asp:TextBox ID="txtRoleName" runat="server"></asp:TextBox>
                                   
                                </td>
                                <td>
                                   
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*Please input Role Name!" ControlToValidate="txtRoleName" ForeColor="Red"></asp:RequiredFieldValidator>
                                   
                                </td>
                                <td style="text-align: right">
                                   
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="auto-style7">
                                   
                                    <asp:Label ID="lblModuleView" runat="server" Text="Allow Module Access?" style="font-weight: 700; text-decoration: underline"></asp:Label>
                                   
                                </td>
                                <td class="auto-style5">
                                   
                                </td>
                                <td class="auto-style8">
                                   
                                </td>
                                <td>
                                   
                                </td>
                                <td>
                                   
                                </td>
                            </tr>
                            <tr>
                                <td class="auto-style7" rowspan="2">
                                   
                                    <asp:CheckBoxList ID="CheckBoxList1" runat="server" Width="256px" style="text-align: left">
                                        <asp:ListItem>Employee Management</asp:ListItem>
                                        <asp:ListItem>Stock Management</asp:ListItem>
                                        <asp:ListItem>Table Management (Backend)</asp:ListItem>
                                        <asp:ListItem>Table Management (Frontend)</asp:ListItem>
                                        <asp:ListItem>Order Management (Frontend)</asp:ListItem>
                                        <asp:ListItem>OrderManagement (Backend)</asp:ListItem>
                                        <asp:ListItem>Menu Management</asp:ListItem>
                                        <asp:ListItem>Reporting</asp:ListItem>
                                    </asp:CheckBoxList>
                                   
                                </td>
                                <td class="auto-style5">
                                   
                                </td>
                                <td class="auto-style8">
                                   
                                </td>
                                <td>
                                   
                                </td>
                                <td>
                                   
                                </td>
                            </tr>
                            <tr>
                                <td class="auto-style5">
                                   
                                </td>
                                <td class="auto-style8">
                                   
                                </td>
                                <td>
                                   
                                </td>
                                <td>
                                   
                                </td>
                            </tr>
                            <tr>
                                <td class="auto-style7">
                                   
                                </td>
                                <td class="auto-style5">
                                   
                                    <asp:Button ID="lblInsertRole" runat="server" Text="Add Role" Width="79px" OnClick="lblInsertRole_Click" />
                                   
                                </td>
                                <td class="auto-style8">
                                   
                                    <asp:Button ID="lblCancel" runat="server" style="text-align: center" Text="Cancel" Width="79px" OnClick="lblCancel_Click" />
                                   
                                </td>
                                <td>
                                   
                                    &nbsp;</td>
                                <td>
                                   
                                </td>
                            </tr>
                        </table>
                    </asp:View>
                    <asp:View ID="View2" runat="server">
                        <table style="border: 1px solid #666;" class="auto-style9">
                           <tr>
                                <td class="auto-style10" colspan="5">
                                   
                                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" DataKeyNames="role" DataSourceID="SqlDataSource1" ForeColor="Black" Width="1282px" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
                                        <Columns>
                                            <asp:BoundField DataField="role" HeaderText="role" ReadOnly="True" SortExpression="role" />
                                            <asp:BoundField DataField="EmployeeManagement" HeaderText="EmployeeManagement" SortExpression="EmployeeManagement" />
                                            <asp:BoundField DataField="TableManagement_front" HeaderText="TableManagement_front" SortExpression="TableManagement_front" />
                                            <asp:BoundField DataField="OrderManagement_front" HeaderText="OrderManagement_front" SortExpression="OrderManagement_front" />
                                            <asp:BoundField DataField="TableManagement_back" HeaderText="TableManagement_back" SortExpression="TableManagement_back" />
                                            <asp:BoundField DataField="OrderManagement_back" HeaderText="OrderManagement_back" SortExpression="OrderManagement_back" />
                                            <asp:BoundField DataField="StockManagement" HeaderText="StockManagement" SortExpression="StockManagement" />
                                            <asp:BoundField DataField="MenuManagement" HeaderText="MenuManagement" SortExpression="MenuManagement" />
                                            <asp:BoundField DataField="Reporting" HeaderText="Reporting" SortExpression="Reporting" />
                                            <asp:TemplateField ShowHeader="False">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Select" Text="Select"></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <FooterStyle BackColor="#CCCCCC" />
                                        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
                                        <RowStyle BackColor="White" />
                                        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                                        <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                        <SortedAscendingHeaderStyle BackColor="#808080" />
                                        <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                        <SortedDescendingHeaderStyle BackColor="#383838" />
                                    </asp:GridView>
                                   
                                </td>
                            </tr>
                            <tr>
                                <td class="auto-style3">&nbsp;</td>
                                <td class="auto-style11">&nbsp;</td>
                                <td class="auto-style12">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="auto-style3">
                                    <asp:Label ID="lblRole" runat="server" Text="Role Name:"></asp:Label>
                                    &nbsp;<asp:TextBox ID="txtnewRole" runat="server"></asp:TextBox>
                                </td>
                                <td class="auto-style11">&nbsp;</td>
                                <td class="auto-style12">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="auto-style3">&nbsp;</td>
                                <td class="auto-style11">&nbsp;</td>
                                <td class="auto-style12">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="auto-style3">
                                    <asp:Label ID="lblModuleView0" runat="server" style="font-weight: 700; text-decoration: underline" Text="Allow Module Access?"></asp:Label>
                                </td>
                                <td class="auto-style11">&nbsp;</td>
                                <td class="auto-style12">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="auto-style7">
                                    <asp:CheckBoxList ID="CheckBoxList2" runat="server" style="text-align: left" Width="256px">
                                        <asp:ListItem>Employee Management</asp:ListItem>
                                        <asp:ListItem>Stock Management</asp:ListItem>
                                        <asp:ListItem>Table Management (Backend)</asp:ListItem>
                                        <asp:ListItem>Table Management (Frontend)</asp:ListItem>
                                        <asp:ListItem>Order Management (Frontend)</asp:ListItem>
                                        <asp:ListItem>OrderManagement (Backend)</asp:ListItem>
                                        <asp:ListItem>Menu Management</asp:ListItem>
                                        <asp:ListItem>Reporting</asp:ListItem>
                                    </asp:CheckBoxList>
                                </td>
                                <td class="auto-style11">&nbsp;</td>
                                <td class="auto-style12">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="auto-style3">&nbsp;</td>
                                <td class="auto-style11">&nbsp;</td>
                                <td class="auto-style12">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                                <td class="auto-style13">&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="auto-style15">
                                   
                                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Authorization]"></asp:SqlDataSource>
                                   
                                </td>
                                <td class="auto-style16">
                                   
                                    <asp:Button ID="Button1" runat="server" Text="Confirm" Width="79px" OnClick="Button1_Click" />
                                   
                                </td>
                                <td class="auto-style17">
                                   
                                    <asp:Button ID="Button2" runat="server" style="text-align: center" Text="Cancel" Width="79px" OnClick="Button2_Click" />
                                   
                                </td>
                                <td class="auto-style18">
                                   
                                    &nbsp;</td>
                                <td class="auto-style18">
                                   
                                </td>
                            </tr>
                        </table>
                    </asp:View>
                </asp:MultiView>
            </td>
        </tr>
    </table>


</asp:Content>
